const state = {
  dialogState: false,
  info: null,
}
const getters = {
  getDialogState() {
    return state.dialogState
  },
  getInfo() {
    return state.info
  },
}

const mutations = {
  openDialog() {
    state.dialogState = true
  },
  closeDialog() {
    state.dialogState = false
  },
  changeInfo(info) {
    state.info = info
  },
  initInfo() {
    state.info = null
  },
}
const actions = {
  openDialog({ commit }) {
    commit('openDialog')
  },
  closeDialog({ commit }) {
    commit('closeDialog')
  },
  changeInfo({ commit }, info) {
    commit('changeInfo', info)
  },
  initInfo({ commit }) {
    commit('initInfo')
  },
}

export default { state, getters, mutations, actions }
